# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nosqli-user-pass-enum
_pkgname=Nosql-MongoDB-injection-username-password-enumeration
pkgver=18.1b3713a
pkgrel=9
pkgdesc='Script to enumerate usernames and passwords from vulnerable web applications running MongoDB.'
groups=('blackarch' 'blackarch-exploitation' 'blackarch-webapp')
arch=('any')
url='https://github.com/an0nlk/Nosql-MongoDB-injection-username-password-enumeration'
license=('custom:unknown')
depends=('python' 'python-argparse' 'python-colorama' 'python-requests')
makedepends=('git')
source=('git+https://github.com/an0nlk/Nosql-MongoDB-injection-username-password-enumeration')
sha512sums=('SKIP')

pkgver() {
  cd $_pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  sed -i '1i\#!/usr/bin/env python' "$_pkgname/$pkgname.py"
}

package() {
  cd $_pkgname

  install -Dm 755 "$pkgname.py" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

